﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ForecastPostInfo.aspx.cs" Inherits="ForecastPostInfo" MasterPageFile="~/APP_Master/MasterPage_Default.master" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <link href="css/webstyle.css" rel="stylesheet" />
    <script src="App_Themes/js/jiangjinjisuan/jquery-1.js" type="text/javascript"></script>
    <script type="text/javascript">
        function fresh() {
            var randomnum = Math.random();
            $("#checkCode_imgmobile").attr("src", "/Ajax/ForecastIdentifyingCode.aspx?" + randomnum);
        }
        function init() {     
            var mark=true;
            var comment = $("#comment").val();
            var yan=$("#checkcode").val();
            if("<%=login %>"=="")
            {
                alert("请先登录！");
                //window.location.href="/Default.aspx"; 
                return;
            }
            if (comment.length == 0) {
                alert("评论不能为空！");
                return;
            }
            else if (yan.length < 4 || yan == "请输入验证码") {
                alert("请输入验证码!");
                return;
            }
            else {
                $.ajax({
                    url: "/Ajax/LotteryData.ashx",
                    data: { t: 'YanZhengMa', yanZhengMa: yan  },
                    type: "post",
                    dataType: "json",
                    async:false,
                    success: function (data) {
                        if (data == 0) {
                            fresh();
                            $("#checkcode").val("请输入验证码");
                            mark=false;
                            alert("验证码错误！");
                            return false;
                        }
                    }
                });
                if( mark==true)
                {
                    $.ajax({
                        url: "/Ajax/LotteryData.ashx",
                        data: { t: 'GenTie', comment: comment , postId:<%=id %>  },
                        type: "post",
                        dataType: "json",
                        success: function (data) {
                            if (data > 0) {
                                alert("发表成功！")
                                window.location.href = window.location.href;
                                $("#comment").val("");
                                $("#checkcode").val("请输入验证码");
                            }
                            else
                            {
                                alert("请先登录！");
                                $("#checkcode").val("请输入验证码");
                            }
                        }
                    });
                }
            }
    }
    function loginout2() {
        if(confirm("确定退出吗？"))
        {
            jQuery.ajax({
                url: "/Ajax/MemberLogin.ashx",
                data: { t: 'login_out' },
                type: "POST",
                success: function (data) {
                    window.location.reload();
                }
            });
        }
    }
    </script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div class="nr" style="min-height: 1120px">
        <div class="tr yctj_title">您当前所在位置：首页 > <span class="yctj_text">预测推荐</span></div>
        <div>
            <div class="ycxx_l">
                <div class="ycxx_title">
                    <span class="ycxx_text1"><%=title %></span><br>
                    <%=time %>      作者： <%=userName %>     已浏览： <%=pageview %> 次
                </div>
                <div class="ycxx"><%=content %></div>
                <div class="ycxx_gt">
                    <%if (login != "")
                        {%>
                    <div><span class="ycxx_text2">跟帖区</span><span class="ycxx_text3"><%=login %> <a href="javascript:loginout2();">,退出</a></span></div>
                    <%}
                        else
                        {%>
                    <div><span class="ycxx_text2">跟帖区</span></div>
                    <%}%>
                    <textarea name="comment" id="comment" class="ycxx_bd"></textarea>
                    <div class="ycxx_text5">
                        <span class="fl">验证码：</span>
                        <input type="text" class="ycxx_bd1" maxlength="4" value="请输入验证码" name="checkcode" id="checkcode" onfocus="this.value=''" onblur="if(this.value==''){this.value='请输入验证码'}" />
                        <span class="code">
                            <a href="javascript:fresh()">
                                <img src="/Ajax/ForecastIdentifyingCode.aspx" id="checkCode_imgmobile" alt="" width="81" height="31" /></a> </span>
                        <input type="button" class="ycxx_btn" value="发表评论" onclick="init()">
                    </div>
                </div>
                <ul class="ycxx_list">
                    <%if (forecastList != null)
                        {
                            for (int i = 0; i < forecastList.Count; i++)
                            {%>
                    <li>
                        <%-- <div class="ycxx_tx">
                            <img src="<%=GetPhoto(forecastList[i].UserID) %>" width="52" height="52"></div>--%>
                        <div>
                            <%--<div class="ycxx_ly">--%>
                            <div class="ycxx_text4">
                                <span class="fl"><%=SelectName(forecastList[i].UserID) %></span><span class="fr"><%=forecastList[i].AddTime.ToString("yyyy-MM-dd HH:mm") %></span>
                                <div class="cl"></div>
                            </div>
                            <div><%=forecastList[i].Comment %></div>
                        </div>
                        <div class="cl"></div>
                    </li>
                    <%}
                        }%>
                </ul>
                <%if (forecastList != null)
                    { %>
                <div class="zdgd_page" style="display: <%=totalCount<11?"none":"block"%>">
                    <webdiyer:AspNetPager SubmitButtonClass="buttons" ID="AspNetPager1"
                        runat="server" AlwaysShow="True" FirstPageText="首页"
                        NextPageText="下一页" PrevPageText="前一页" LastPageText="尾页" PageSize="10"
                        OnPageChanged="AspNetPager1_PageChanged">
                    </webdiyer:AspNetPager>
                </div>
                <%}%>
            </div>
            <div class="yctj_r">
                <div class="yctj_notice">
                    <div class="yctj_r_title">最新公告</div>
                    <ul class="yctj_r_list">
                        <% if (forecastNew != null)
                            {
                                int count = forecastNew.Count;
                                if (forecastNew.Count > 4)
                                {
                                    count = 4;
                                }
                                for (int i = 0; i < count; i++)
                                {%>
                        <li><a href="news_details.aspx?id=<%=forecastNew[i].id%>&type=5"><span class="f18"><< <%=forecastNew[i].Title.Length>16 ?forecastNew[i].Title.Substring(0,16)+"...":forecastNew[i].Title %></span><span class="fr"><%=forecastNew[i].AddTime.ToString("MM-dd")%></span></a></li>
                        <%--                        <li><a href="ForecastPostInfo.aspx?id=<%=forecastNew[i].id %>"><span class="fl"><< <%=forecastNew[i].Title.Length > 16 ? forecastNew[i].Title.Substring(0, 16) : forecastNew[i].Title %> </span><span class="fr"><%=forecastNew[i].AddTime.ToString("MM-dd") %></span></a></li>--%>
                        <%}
                            } %>
                    </ul>
                </div>
                <div style="padding: 10px 0 0 0;">
                    <div class="yctj_r_title1"><span class="fl">中彩排行</span><span class="fr" style="font-size: 13px;">本站累计中奖 <span style="color: #d82715"><%=jiangjin2 %></span> 亿元</span></div>
                    <ul class="yctj_r_list1">
                        <%if (userAccount != null && userAccount.Count > 0)
                            {
                                for (int i = 0; i < (userAccount.Count > 12 ? 12 : userAccount.Count); i++)
                                {  %>
                        <li><span <%if (i < 3)
                                { %>class="dj_text3"
                            <%}
                                else
                                { %>
                            class="yctj_text3" <%} %>><%=i+1 %></span> <span><%=SelectName(userAccount[i].user_id)%> </span><span class="fr tr"><%=Math.Round(Convert.ToDecimal(userAccount[i].winTotal) % 100000000 / 10000,2)%> 万元 </span></li>
                        <% }
                            }%>
                    </ul>
                </div>
                <div style="padding: 10px 0 0 0;">
                    <div class="yctj_r_title1"><span class="fl">推荐方案</span><a href="ForecastPost_List.aspx" class="fr" style="font-size: 12px; color: #6c6c6c;">更多>></a></div>
                    <ul class="yctj_r_list2">
                        <%if (tzlist != null && tzlist.Count > 0)
                            { %>
                        <%for (int k = 0; k < tzlist.Count; k++)
                            {%>
                        <li>· <a href="ForecastPostInfo.aspx?id=<%=tzlist[k].id %>"><%=tzlist[k].Title.Length > 16 ? tzlist[k].Title.Substring(0, 16)+"..." : tzlist[k].Title %></a></li>
                        <%--<li><a href="ForecastPostInfo.aspx?id=<%=tzlist[k].id%>&type=7"><%=tzlist[k].Title%></a></li>--%>
                        <%}
                            }%>
                    </ul>
                </div>
                <div style="padding: 12px 0 0 0;">
                    <img src="images/yctj_ad.jpg" width="280" height="146">
                </div>
                <div style="padding: 12px 0 0 0;">
                    <img src="images/yctj_ad.jpg" width="280" height="146">
                </div>
            </div>
            <div class="cl"></div>
        </div>
    </div>
</asp:Content>


